<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html:html>
	<head>
		<title><bean:message key="SearchOwner.SearchUser"/></title>
		<link rel="stylesheet" type="text/css" href="css/formas.css">
		<script language="javascript" type="text/javascript" src="js/util.js"></script>
		<script>
		function fnc_seleccionarUsuario(campo){
			if( campo.selectedIndex > -1 ){
				var arr_nombre = campo.options[campo.selectedIndex].text.split(' - ');
				var str_nombre = arr_nombre[1];
				window.opener.document.forms[0].int_responsable.value = campo.options[campo.selectedIndex].value;
				window.opener.document.forms[0].str_responsable.value = str_nombre;
				window.close();
			}else{
				alert("<bean:message key='Application.Error(s)'/> : \n<bean:message key='SearchOwner.SelUser'/>");
			}
		}
		function fnc_cerrar(){
			window.opener.document.forms[0].int_responsable.value = "";
			window.opener.document.forms[0].str_responsable.value = "";
			window.close();
			
		}
		</script>
	</head>
	<body>
		<html:form action="user_search" focus="str_user">
			<html:hidden property="action" value="searchUser"/>
			<table width="100%" border="0" cellspacing="1" cellpadding="0" class="info_formas">
				<tr>
					<td colspan="2" class="formas-encabezado"><bean:message key="SearchOwner.SearchOwner"/></td>
			  </tr>
				<tr>
					<td colspan="2" align="center" class="">
						<html:text property="str_user"/><html:submit property="btn_buscar"><bean:message key="Application.Search"/></html:submit>
					</td>
				</tr>
				<tr>
				  <td width="50%" align="right" valign="top" class=""><bean:message key="SearchOwner.Owner"/>:&nbsp;<br></td>
				    <td width="50%" align="left">&nbsp;
					    <html:select property="sel_users" size="10" style="width:300" ondblclick="fnc_seleccionarUsuario(this);">
					    	<logic:present name="req_users">
					    		<html:options collection="req_users" property="id" labelProperty="idNombre"/>
					    	</logic:present>
						</html:select>
			        </td>
				</tr>
				<tr>
					<td colspan="2" align="center">
					<bean:message key="SearchOwner.dblClick"/><br>
						<html:button property="btn_cancelar" onclick="fnc_cerrar();"><bean:message key="Application.Cancel"/></html:button>
					</td>
				</tr>
		  </table>
		</html:form>
	</body>
</html:html>